n,L,r,t=map(int,input().split())

a=[]
s=[[0 for i in range(0,n)] for j in range(0,n)]

for i in range(0,n):
    rows=list(map(int,input().split()))
    a.append(rows)

for i in range(0,n):
    for j in range(0,n):
        a[i][j]=a[i][j]-t
        #print(a[i][j])
        if i==0 and j==0:
            s[i][j]=a[i][j]
        elif i==0:
            s[i][j]=s[i][j-1]+a[i][j]
        elif j==0:
            s[i][j]=s[i-1][j]+a[i][j]
        else:
            s[i][j]=s[i-1][j]-s[i-1][j-1]+s[i][j-1]+a[i][j]

#for i in range(0,n):
#    for j in range(0,n):
#        print(a[i][j],end=" ")
#    print()

result=0

for i in range(0,n):
    for j in range(0,n):
        x1=max(i-r,0)
        y1=max(j-r,0)
        x2=min(i+r,n-1)
        y2=min(j+r,n-1)
        
        p=0
        if x1==0 and y1==0:
            p=s[x2][y2]
        elif x1==0:
            p=s[x2][y2]-s[x2][y1-1]
        elif y1==0:
            p=s[x2][y2]-s[x1-1][y2]
        else:
            p=s[x2][y2]-s[x1-1][y2]-(s[x2][y1-1]-s[x1-1][y1-1])

        if p<=0:
            result+=1

print(result)